function liraNN = main(dataSize, hPos, hNeg, gWindowLength, defSpace, incrementValue)
    addpath('./base');
    addpath('./lira');
    addpath('./util');

    disp('Loading dataset...');
    tic
    [I,labels,I_test,labels_test] = loadDataset(dataSize, 1);
    toc

    disp('Building LiRA features...');
    tic
    for i=1:length(labels)
        featureSet(i) = LiraFeature(hPos, hNeg, gWindowLength, I{i});
    end
    toc

    timestampString = datestr(now, 'yymmddhhMMss');
    
    resultWorkspaceString = ['lira-nn_', int2str(dataSize), '_', timestampString,...
        '_', int2str(hPos), '_', int2str(hNeg), '_',...
        int2str(gWindowLength), '_', num2str(defSpace), '_',...
        num2str(incrementValue)];
    
    trainingTimeStart = tic;
    %profile on
    liraNN = LiraNeuralNetwork(featureSet, defSpace, incrementValue, I,...
        labels, 999, 0, resultWorkspaceString);
    %profile off
    %profsave(profile('info'), [resultWorkspaceString, '_profile'])
    trainingTime = toc(trainingTimeStart);
    
    save(resultWorkspaceString, 'liraNN','I','labels','I_test',...
        'labels_test', 'trainingTime');
end

